package com.itheima.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SetmealCheckGroupDao {

    @Select("select checkgroup_id from t_setmeal_checkgroup where setmeal_id = #{id} ")
    List<Integer> findCheckGroupIdsBySetmealId(String id);

    int addRelation(@Param("checkgroupIds") List<String> checkgroupIds,@Param("setmealId")Integer setmealId);

    @Delete("delete from t_setmeal_checkgroup where setmeal_id=#{setmealId}")
    int deleteRelation(Integer setmealId);

    @Select("select count(*) from t_setmeal_checkgroup where checkgroup_id = #{checkGroupId}")
    int containCheckGroup(String checkGroupId);
}
